{include file=header.html}
<script type="text/javascript">
$(function(){
	var map = new BMap.Map("allmap");
	var point = new BMap.Point({$store.lng}, {$store.lat});
	map.centerAndZoom(point, 14);
	var marker = new BMap.Marker(point);  // 创建标注
	map.addOverlay(marker);               // 将标注添加到地图中
	//marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
	map.addControl(new BMap.NavigationControl());    
	
	getInfoWin(map, point)
	marker.addEventListener("click", function(e){		
		var pt = new BMap.Point(e.point.lng, e.point.lat);
		getInfoWin(map, pt);
	})	
});
function getInfoWin(map, pt)
{
	var geoc = new BMap.Geocoder();    
	geoc.getLocation(pt, function(rs){
		var addComp = rs.addressComponents;
		var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
		var html = '<div class="clearfix fs12" style="padding-left:40px"><p class="float-left" style="margin-left:-40px"><img width="35" src="{$site_url}/{$store.store_logo}"></p><p class="float-left">{$store.store_name}<br>地址:'+address+'</p></div>'
		var infoWindow = new BMap.InfoWindow(html);  // 创建信息窗口对象   
		map.openInfoWindow(infoWindow, pt);      // 打开信息窗口	
	});
}
</script>
<div id="page-store" class="page-store">
	<div style="border:5px #ddd solid;">
		<div style="width:100%;height:400px" id="allmap"></div>
    </div>
</div>
{include file=footer.html}
